package com.ruoyi.web.controller.maniubi;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.User;
import com.ruoyi.system.service.impl.RegisterServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通讯录控制层
 * 
 * @author 丁
 */
@RestController
@RequestMapping("/maniubi/com/api")
public class ManageController extends BaseController {
    @Autowired
    private RegisterServiceImpl registerService;
    /**
     *注册
     */
    @PostMapping("/register")
    public AjaxResult register(@RequestBody User user) {
//         registerService.register(user);
        AjaxResult register = registerService.register(user);

        return register;
    }

    /**
     *登录
     */
    @PostMapping("/login")
    public AjaxResult login(@RequestBody User user) {

        AjaxResult login = registerService.login(user);


        return login;
    }

}
